package com.bcbim.operation_maintenance.department.mapper;

import com.bcbim.operation_maintenance_interface.business_department.vo.ListBusinessDepartmentVO;
import com.bcbim.common.sys.Code;
import com.bcbim.operation_maintenance_interface.department.dao.DepartmentDAO;
import com.bcbim.operation_maintenance_interface.department.dto.DepartmentNameCheckDTO;
import com.bcbim.operation_maintenance_interface.department.vo.DepartmentDetailVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import com.bcbim.operation_maintenance_interface.space.dto.SpaceColorTypeDTO;

import java.util.List;

/**
 * @version V 1.0.0
 * @Description：部门mapper
 * @Author: xuehao
 * @Date: 2022/3/8 17:36
 **/
@Mapper
public interface DepartmentMapper {

    /**
     * 业务部下拉
     *
     * @author xuehao
     * @createDate 2022/3/9 15:27
     * @retuen List<Code>
     */
    List<Code> pullBusinessDepartment(String projectId);

    /**
     * 新增部门
     *
     * @param departmentDAO
     * @author xuehao
     * @createDate 2022/3/9 15:37
     * @retuen int
     */
    int insertDepartment(DepartmentDAO departmentDAO);

    /**
     * 编辑部门
     *
     * @param departmentDAO
     * @author xuehao
     * @createDate 2022/3/9 15:45
     * @retuen int
     */
    int updateDepartment(DepartmentDAO departmentDAO);

    /**
     * 查询部门详情
     *
     * @author xuehao
     * @createDate 2022/3/9 16:21
     * @retuen DepartmentDetailVO
     */
    DepartmentDetailVO getDepartment(String id);

    /**
     * 判断部门名称是否重复
     *
     * @param departmentNameCheckDTO
     * @author xuehao
     * @createDate 2022/3/9 16:42
     * @retuen int
     */
    int checkDepartmentName(DepartmentNameCheckDTO departmentNameCheckDTO);

    /**
     * 颜色下拉
     *
     * @author xuehao
     * @createDate 2022/3/13 14:57
     * @retuen Code
     */
    List<Code> pullColour();

    /**
     * 颜色图例
     *
     * @author xuehao
     * @createDate 2022/3/13 14:57
     * @retuen Code
     */
    List<Code> colourCategory(SpaceColorTypeDTO spaceColorTypeDTO);

    List<Code> colourType(SpaceColorTypeDTO spaceColorTypeDTO);

    List<Code> colourBusiness(SpaceColorTypeDTO spaceColorTypeDTO);

    List<Code> colourDepartment(SpaceColorTypeDTO spaceColorTypeDTO);

    /**
     * 部门列表
     *
     * @Author: haomeijie
     * @Date: 2022/3/22 18:39
     */
    List<ListBusinessDepartmentVO> listDepartment(@Param("name") String name, @Param("projectId") String projectId);

    /**
     * 获取未指派id
     *
     * @param businessDepartmentId
     * @param unassignedName
     * @return String
     * @Author: haomeijie
     * @Date: 2022/4/6 17:26
     */
    String getUnassignedId(@Param("businessDepartmentId") String businessDepartmentId, @Param("unassignedName") String unassignedName);
}
